package com.jie.myvhr.controller;

import com.jie.myvhr.bean.Hr;
import com.jie.myvhr.bean.Menu;
import com.jie.myvhr.common.HrUtils;
import com.jie.myvhr.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author jie
 * @date 2019/6/29 -9:32
 */
@RestController
@RequestMapping("/config")
public class configController {
    @Autowired
    MenuService menuService;

    @GetMapping("/sysmenu")
    public List<Menu> sysmenu() {

        return menuService.getMenusByHrId();
    }

    @RequestMapping("/hr")
    public Hr currentUser() {
        return HrUtils.getCurrentHr();
    }
}
